package com.infoland.common.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;
import com.jfinal.ext.plugin.shiro.ShiroKit;
import com.jfinal.ext.plugin.shiro.ShiroMethod;

public class AdminInterceptor implements Interceptor {

	@Override
	public void intercept(Invocation me) {
		Controller c = me.getController();
		if (ShiroMethod.notAuthenticated()) {
			c.redirect(ShiroKit.getLoginUrl());
		}
		me.invoke();
	}

}
